<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
</head>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top"><span style="display: none;">
        加载中...</span> <span>验证安全密码</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="{:U('Index/resetWay')}" class="iconfont back"></a>
    </header>

    <div data-v-f34f19c0="" class="main" s="[object Object]">
        <input type="hidden" name="id" id="uid" value="{$id}">
        <table data-v-f34f19c0="">
            <tbody data-v-f34f19c0="">
            <tr data-v-f34f19c0="">
                <td data-v-f34f19c0="">原安全密码</td>
                <td data-v-f34f19c0="">
                    <input data-v-f34f19c0="" type="password" tag="原安全密码" placeholder="请输入当前所使用的密码" class="va19" name="Password" id="pass">
                </td>
            </tr>
            <tr data-v-f34f19c0=""></tr>
            </tbody>
        </table> <!---->
        <div data-v-f34f19c0="" class="loginBtn BTN">
            <a data-v-f34f19c0="" onclick="sav()">确定</a>
        </div>
        <div data-v-f34f19c0="" class="tips">
            安全密码用于提现、绑定银行卡等操作，可保障资金安全。
        </div>
    </div>
    <!--弹框 开始-->
    <div id="anquan_buweikong" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">·原安全密码不能为空·</div>
                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <!--弹框 结束-->
    <!--弹框 开始-->
    <div id="buzhengque" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">·原安全密码输入不正确，请重新输入!·</div>
                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <!--弹框 结束-->
</div>
</body>
</html>

<script>
    $(".layermbtn").click(function(){
        $(".layermbox").hide();
        window.location.href = "";
    });
    //验证原密码
    function sav() {
        var id = $("#uid").val();
        var pass = $("#pass").val();
        if (pass == '') {
            $("#anquan_buweikong").show();
            return false;
        }

        $.ajax({
            type: "POST",
            url: "{:U('Index/verifySafePwd')}",
            data: {'pass': pass, 'id': id},
            dataType: "json",
            success: function (data) {
                if (data == 1) {
                    $("#buzhengque").show();
                    return false;
                }else if (data == 0) {
                    window.location.href = "/Index/verifyPwd2/id/"+id;
                }
            }
        });
    }
</script>